let arr = [
    { x: -64, s: .83, z: 1 },
    { x: 140, s: 1, z: 2 },
    { x: 338, s: .83, z: 1 },
    { x: 960, s: .83, z: 1 },
    { x: 960, s: .83, z: 1 },
    { x: 960, s: .83, z: 1 },
]
let swiperObjs = document.querySelectorAll('.swiper .swiper-slide')
function render() {
    swiperObjs.forEach(function (item, i) {
        item.style.transform = `translateX(${arr[i].x}px) scale(${arr[i].s})`
        item.style.zIndex = arr[i].z
    })
}
render()
function next() {
    let temp = arr.pop()
    arr.unshift(temp)
    render()
}
let swiperNext = document.querySelector('.swiper .swiper-next')
swiperNext.onclick = function () {
    next()
}
function prve() {
    let temp = arr.shift()
    arr.push(temp)
    render()
}
let swiperPrev = document.querySelector('.swiper .swiper-prev')
swiperPrev.onclick = function () {
    prve()
}

swiperObjs.forEach(function (item) {
    item.onclick = function () {
        let style=item.style.transform
        if (style.indexOf('64px') != -1) prve()
        if (style.indexOf('338px') != -1) next()
    }
})

